<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <script src="./lib/vue-2.6.12.js"></script>
    <title>8axios的基本使用</title>
  </head>
  <body>
    <div id="app"></div>
    <script src="./lib/axios.js"></script>
    <script>
      // console.log(axios);
      // http://www.liulongbin.top:3006/api/getbooks

      //调用axios得到返回值是promise对象
      axios({
        // 请求方法
        method: "GET",
        // 地址
        url: "http://www.liulongbin.top:3006/api/getbooks",
        // url查询参数
        params:{
            id:1
        },
        // 请求体参数 post
        data:{}
      }).then(function (result) {
        console.log(result);
      });

      const vm = new Vue({
        el: "#app",
        data: {},
        methods: {},
        filters: {},
        watch: {},
        computed: {},
      });
    </script>
  </body>
</html>
